#include "PanelWidget.h"

PanelWidget::PanelWidget(const Point2D& position, const Point2D& size)
    : _position(position),
      _size(size),
      _panel_surface(Graphics::NewSurface(_size)) 
{
    _offset.x = _position.GetX();
    _offset.y = _position.GetY();
}

void PanelWidget::Render(SDL_Surface* surface)
{
    DisplayObjectContainer::Render(_panel_surface);
    
    SDL_BlitSurface( _panel_surface, NULL, surface, &_offset );
}

const Point2D& PanelWidget::GetPosition() const
{
    return _position;
}

const Point2D& PanelWidget::GetSize() const
{
    return _size;
}
